<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\svip\osp\service;

class GetUserBasicInfoForNova {
	
	static $_TSPEC;
	public $openCardActCodeList = null;
	public $appName = null;
	public $unionActCodeList = null;
	public $onTrialPromoteThreshold = null;
	public $openingPromoteThreshold = null;
	public $previewMode = null;
	public $previewTime = null;
	public $vmi_token = null;
	public $priorityUnionCard = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			1 => array(
			'var' => 'openCardActCodeList'
			),
			2 => array(
			'var' => 'appName'
			),
			3 => array(
			'var' => 'unionActCodeList'
			),
			4 => array(
			'var' => 'onTrialPromoteThreshold'
			),
			5 => array(
			'var' => 'openingPromoteThreshold'
			),
			6 => array(
			'var' => 'previewMode'
			),
			7 => array(
			'var' => 'previewTime'
			),
			8 => array(
			'var' => 'vmi_token'
			),
			9 => array(
			'var' => 'priorityUnionCard'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['openCardActCodeList'])){
				
				$this->openCardActCodeList = $vals['openCardActCodeList'];
			}
			
			
			if (isset($vals['appName'])){
				
				$this->appName = $vals['appName'];
			}
			
			
			if (isset($vals['unionActCodeList'])){
				
				$this->unionActCodeList = $vals['unionActCodeList'];
			}
			
			
			if (isset($vals['onTrialPromoteThreshold'])){
				
				$this->onTrialPromoteThreshold = $vals['onTrialPromoteThreshold'];
			}
			
			
			if (isset($vals['openingPromoteThreshold'])){
				
				$this->openingPromoteThreshold = $vals['openingPromoteThreshold'];
			}
			
			
			if (isset($vals['previewMode'])){
				
				$this->previewMode = $vals['previewMode'];
			}
			
			
			if (isset($vals['previewTime'])){
				
				$this->previewTime = $vals['previewTime'];
			}
			
			
			if (isset($vals['vmi_token'])){
				
				$this->vmi_token = $vals['vmi_token'];
			}
			
			
			if (isset($vals['priorityUnionCard'])){
				
				$this->priorityUnionCard = $vals['priorityUnionCard'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'GetUserBasicInfoForNova';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("openCardActCodeList" == $schemeField){
				
				$needSkip = false;
				
				$this->openCardActCodeList = array();
				$_size0 = 0;
				$input->readListBegin();
				while(true){
					
					try{
						
						$elem0 = null;
						$input->readString($elem0);
						
						$this->openCardActCodeList[$_size0++] = $elem0;
					}
					catch(\Exception $e){
						
						break;
					}
				}
				
				$input->readListEnd();
				
			}
			
			
			
			
			if ("appName" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->appName);
				
			}
			
			
			
			
			if ("unionActCodeList" == $schemeField){
				
				$needSkip = false;
				
				$this->unionActCodeList = array();
				$_size1 = 0;
				$input->readListBegin();
				while(true){
					
					try{
						
						$elem1 = null;
						$input->readString($elem1);
						
						$this->unionActCodeList[$_size1++] = $elem1;
					}
					catch(\Exception $e){
						
						break;
					}
				}
				
				$input->readListEnd();
				
			}
			
			
			
			
			if ("onTrialPromoteThreshold" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->onTrialPromoteThreshold); 
				
			}
			
			
			
			
			if ("openingPromoteThreshold" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->openingPromoteThreshold); 
				
			}
			
			
			
			
			if ("previewMode" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->previewMode); 
				
			}
			
			
			
			
			if ("previewTime" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->previewTime); 
				
			}
			
			
			
			
			if ("vmi_token" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->vmi_token);
				
			}
			
			
			
			
			if ("priorityUnionCard" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->priorityUnionCard); 
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		if($this->openCardActCodeList !== null) {
			
			$xfer += $output->writeFieldBegin('openCardActCodeList');
			
			if (!is_array($this->openCardActCodeList)){
				
				throw new \Osp\Exception\OspException('Bad type in structure.', \Osp\Exception\OspException::INVALID_DATA);
			}
			
			$output->writeListBegin();
			foreach ($this->openCardActCodeList as $iter0){
				
				$xfer += $output->writeString($iter0);
				
			}
			
			$output->writeListEnd();
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->appName !== null) {
			
			$xfer += $output->writeFieldBegin('appName');
			$xfer += $output->writeString($this->appName);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->unionActCodeList !== null) {
			
			$xfer += $output->writeFieldBegin('unionActCodeList');
			
			if (!is_array($this->unionActCodeList)){
				
				throw new \Osp\Exception\OspException('Bad type in structure.', \Osp\Exception\OspException::INVALID_DATA);
			}
			
			$output->writeListBegin();
			foreach ($this->unionActCodeList as $iter0){
				
				$xfer += $output->writeString($iter0);
				
			}
			
			$output->writeListEnd();
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->onTrialPromoteThreshold !== null) {
			
			$xfer += $output->writeFieldBegin('onTrialPromoteThreshold');
			$xfer += $output->writeI32($this->onTrialPromoteThreshold);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->openingPromoteThreshold !== null) {
			
			$xfer += $output->writeFieldBegin('openingPromoteThreshold');
			$xfer += $output->writeI32($this->openingPromoteThreshold);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->previewMode !== null) {
			
			$xfer += $output->writeFieldBegin('previewMode');
			$xfer += $output->writeI32($this->previewMode);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->previewTime !== null) {
			
			$xfer += $output->writeFieldBegin('previewTime');
			$xfer += $output->writeI64($this->previewTime);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->vmi_token !== null) {
			
			$xfer += $output->writeFieldBegin('vmi_token');
			$xfer += $output->writeString($this->vmi_token);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->priorityUnionCard !== null) {
			
			$xfer += $output->writeFieldBegin('priorityUnionCard');
			$xfer += $output->writeI32($this->priorityUnionCard);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>